﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   namespace="PSAdmin.Core.Security"
                   assembly="PSAdmin.Core">
  <class name="UserRole" table="UserRoles">
    <id name="Id">
      <generator class="guid"/>
    </id>
    <property name="Name" type="string"/>
    <set name="Users" table="UserRoleMappings" cascade="all-delete-orphan">
      <key column="RoleId"/>
      <one-to-many class="UserRoleMapping"/>
    </set>
  </class>
  <class name="UserRoleMapping" table="UserRoleMappings" dynamic-update="true">
    <id name="Id">
      <generator class="guid"/>
    </id>
    <property name="Username"/>
  </class>
</hibernate-mapping>